



/*
 * Class MP
 * 
 * Parses a specified input file and prints whether the
 * file was successfully printed or not.
 * 
 * Input file can be given as command line argument.
 * If no arguments are given, a hard coded file name
 * will be used.
 * 
 */
public class MP {
	public static void main(String[] args) throws SyntacticException,
			SemanticException {
		// String inFile = "Sample.in";
		String inFile = "Algebra.decaf";
		if (args.length > 1) {
			inFile = args[0];
		}

		Lexer lexer = new Lexer(inFile);

		Parser parser = new Parser(lexer);
		ClassDecl res = parser.parse();
		System.out.println(res);
		System.out.println("File parsed successfully");
		res.check();
		System.out.println("File semantically checked successfully!");
		// / ArrayList<Expr> expressions = parser.parse();

		// for(Expr e: expressions) {
		// System.out.print(e);
		// System.out.println("Value = " + e.evaluate() + "\n");
		// }
	}
}
